/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Servlet.business;

import Model.Business.BusinessClass;
import RssEasy.Core.HttpRequestHelper;
import RssEasy.Core.ServletRequestHelper;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author lipeng
 */
public class businessclass extends ServletRequestHelper {

    @Override
    protected HttpRequestHelper request(HttpServletRequest request, HttpServletResponse response) {
        super.request(request, response);
        try {
            BusinessClass bc = new BusinessClass(pageContext);
            bc.select("parentid,category").where("parentid=?", request.getParameter("parendid")).query();
            out.print(bc.toKeyValue());
        } catch (Exception e) {
            out.print("{\"error\":\"" + e.getMessage() + "\"}");
        }
        return this;
    }
}
